package com.ruoyi.bbsAdmin.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.bbsAdmin.domain.UserSchool;
import com.ruoyi.bbsAdmin.domain.bbs_user;
import com.ruoyi.bbsAdmin.domain.vo.childrenCommentRedisVo;
import com.ruoyi.bbsAdmin.domain.vo.contentRedisVo;
import com.ruoyi.bbsAdmin.domain.vo.mainCommentRedisVo;
import com.ruoyi.bbsAdmin.mapper.CommentMapper;
import com.ruoyi.bbsAdmin.mapper.ContentMapper;
import com.ruoyi.bbsAdmin.service.RedisService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;

@Service
public class RedisServiceImpl implements RedisService {


    @Override
    public int addOneWeekHomeContentToRedis(int schoolId, String queryTime) {

        return 1;
    }

    @Override
    public int deleteHomeContentInRedisOneWeekAgo(Integer schoolId) {

        return 1;
    }


    //redis帖子列表：增（单体）
    @Override
    public int addHomeContentToRedis(String contentId) {
        return 1;
    }

    //redis帖子列表：增（列表）
    @Override
    public int addHomeContentListToRedis(List<contentRedisVo> homeContentVOList) {
        return 1;
    }

    //redis帖子列表：删（单体）
    @Override
    public int deleteHomeContentInRedis(double timestampInRedis, String contentId) {
        return 1;
    }

    //redis帖子列表：删（列表：删除redis中时间戳小于传入时间戳的帖子列表）
    @Override
    public int deleteHomeContentListInRedis(double timestamp, int schoolId) {
        return 1;
    }

    //redis帖子列表：改
    @Override
    public int updateHomeContentInRedis(double timestampInRedis, String contentId) {
        return 1;
    }


    //redis主评论列表：增（单体）
    @Override
    public int addMainCommentToRedis(int schoolId, String contentId, String commentId) {
        return 1;
    }


    //redis主评论列表：删
    @Override
    public int deleteMainCommentInRedis(int schoolId, String contentId, String commentId, double timestampInRedis) {
        return 1;
    }

    //redis主评论列表：改
    @Override
    public int updateMainCommentInRedis(int schoolId, String contentId, String commentId, double timestampInRedis) {
        return 1;
    }


    //redis子评论列表：改（增、删、改）
    @Override
    public int updateChildrenCommentInRedis(int schoolId, String contentId, String commentId, double timestampInRedis) {
        return 1;
    }

    @Override
    public int updateSomeUserInfoInRedis(String userId, Map<String, String> updateInfoMap) {
        return 1;
    }

    @Override
    public int updateUserInfoInRedis(bbs_user userInfo) {
        return 1;
    }


    @Override
    public int updateUserSchoolInfoInRedis(UserSchool userSchoolInfo) {
        return 1;
    }

    @Override
    public int updateContentInfoInRedis(String contentId) {
        return 1;
    }

    @Override
    public Boolean deleteSchoolListInRedis() {
        return true;
    }


}
